package com.yw.util.spring;

import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;

public class SpringApplicationContext {
	private static ApplicationContext context;

	/***
	 * 设置公共spring context对象
	 * 
	 * @param arg
	 * @throws BeansException
	 */
	public static void setApplicationContext(ApplicationContext arg)
			throws BeansException {
		context = arg;
	}

	public static Object getBean(String id) {
		return context.getBean(id);
	}
}
